package com.yingxin.yx.framework.user.core;

import com.yingxin.yx.framework.user.dto.OnLineUser;
import com.yingxin.yx.framework.user.dto.UserDto;

import java.util.List;
import java.util.Map;

/**
 * @author fanchao
 */

public interface IUserSupport {

    ThreadLocal<UserDto> THREAD_USER = new ThreadLocal<>();

    /**
     * 获取身份
     *
     * @return 身份
     */
    UserDto getUser();

    UserDto getUser(String userId);

    /**
     * 获取所有登录在线用户
     */
    List<OnLineUser> getPCLoginUser(Map<String,String> map);
    List<OnLineUser> getAppLoginUser(Map<String,String> map);

    void putUser(UserDto user);

    void kickOutUser(String userId);

    void forceOutUser(String userId,String type);

    String getUserId();

    String getStaffName();

    void activateReloadPermissions();

    void activateReloadPermissionsByUser(String userId);

    Boolean isReloadPermissions(String userId);

    Boolean hasRole(String role);

    Boolean hasPermission(String permission);

    String viewBy(String permission);

    Boolean checkUserPermission(String permission);

    List<String> getAuthCompanyIds();

    void checkAuthCompany(String companyId);

    // LicenseResult checkLicense();

}